package com.gitee.wsl.struct.generator.sample

import kotlin.test.assertEquals


/**
 * Long 类型ID生成器单元测试
 *
 * @author liuzhaoming
 * @date 2017/11/23
 * @see LongIdGenerator
 */
/*
class LongIdGeneratorTest {
    private val generator: LongIdGenerator = LongIdGenerator(1L)

    @Test
    fun generateId() {
        val id: Long = generator.generate()
        assertEquals(19, id.toString().length)
        java.lang.System.out.println(generator.generate())
    }

    @Test
    fun parse() {
        val id: Long = generator.generate()
        val results: Array<Long> = generator.parse(id)
        val timestamp = results[0]
        val dateTime: java.time.LocalDateTime = java.time.LocalDateTime.ofInstant(
            java.time.Instant.ofEpochMilli(timestamp),
            java.time.ZoneId.systemDefault()
        )

        println(
            "Time: " + java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:dd")
                .format(dateTime)
        )
        println("Machine id: " + results[1])
        println("Sequence: " + results[2])
    }
}*/
